class Stack(object):
    def __init__(self, list = []):
        self.stack = []
        for i in list:
            self.push(i)
    def push(self, item):
        self.stack.append(item)
    def pop(self):
        return self.stack.pop()
    def length(self):
        return len(self.stack)
    def top(self):
        return self.stack[len(self.stack)-1]
